{include file='common/head'}
<div style="overflow-x: hidden;width: 96%;margin: auto;padding-top: 1rem;">


    <div class="layui-form" action="" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-inline">
                <input type="text" name="name"  lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
            </div>
            <label class="layui-form-label">性别</label>
            <div class="layui-input-inline">
                <input type="text" name="sex"  lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
            </div>
            <label class="layui-form-label">年龄</label>
            <div class="layui-input-inline">
                <input type="text" name="age"  lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
            </div>
            <label class="layui-form-label">手机号</label>
            <div class="layui-input-inline">
                <input type="text" name="phone"  lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
            </div>

        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">所属项目</label>
            <div class="layui-input-inline">
                <select name="project_id"  lay-search>
                <option value="">筛选所属项目</option>
                <option value="1">项目1</option>
                <option value="2">项目2</option>
                <option value="3">项目3</option>
                <option value="4">项目4</option>
                </select>
            </div>
            <label class="layui-form-label">面试公司</label>
            <div class="layui-input-inline">
                <input type="text" name="interview_company"  lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
            </div>
            <label class="layui-form-label">身份证号</label>
            <div class="layui-input-inline">
                <input type="text" name="id_number"  lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
            </div>
            <label class="layui-form-label">密号</label>
            <div class="layui-input-inline">
                <input type="text" name="secret_number"  lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否交社保</label>
            <div class="layui-input-inline">
                <select name="is_social"  lay-search>
                    <option value="0">否</option>
                    <option value="1" selected>是</option>
                </select>
            </div>
            <label class="layui-form-label">社保基数</label>
            <div class="layui-input-inline">
                <input type="text" name="social_base"  lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
            </div>
            <label class="layui-form-label">社保地区</label>
            <div class="layui-input-inline">
                <input type="text" name="social_area"  lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
            </div>
            <label class="layui-form-label">是否住宿</label>
            <div class="layui-input-inline">
                <select name="is_stay"  lay-search>
                    <option value="0">否</option>
                    <option value="1" selected>是</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否签合同</label>
            <div class="layui-input-inline">
                <select name="is_contract"  lay-search>
                    <option value="0">否</option>
                    <option value="1" selected>是</option>
                </select>
            </div>
            <label class="layui-form-label">所属人</label>
            <div class="layui-input-inline">
                <input type="text" name="admin_id"  lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
            </div>
            <label class="layui-form-label">入职部门</label>
            <div class="layui-input-inline">
                <select name="depart_id"  lay-search>
                    <option value="">筛选所属部门</option>
                    <option value="1">部门1</option>
                    <option value="2">部门2</option>
                    <option value="3">部门3</option>
                    <option value="4">部门4</option>
                </select>
            </div>
            <label class="layui-form-label">招聘方式</label>
            <div class="layui-input-inline">
                <select name="is_contract"  lay-search>
                    <option value="1">渠道 </option>
                    <option value="2" selected>正常招聘</option>
                </select>
            </div>

        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-col-xs3">
                <input type="radio" name="status" value="1" title="邀约中" >
                <input type="radio" name="status" value="2" title="到面"  >
                <input type="radio" name="status" value="3" title="通过"  >
                <input type="radio" name="status" value="4" title="未通过" >
                <input type="radio" name="status" value="5" title="待入职" >
                <input type="radio" name="status" value="6" title="入职"  >
                <input type="radio" name="status" value="7" title="在职"  >
                <input type="radio" name="status" value="8" title="离职"  >
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="demo1">保存</button>
            </div>
        </div>
    </div>


</div>
{include file='common/footer'}
<script>

    layui.use('layedit', function(){
        var layedit = layui.layedit;
        layedit.set({
            uploadImage: {
                url: '{:url("Upload/file_content")}' //接口url
                ,type: 'post' //默认post
            }
        });
        //注意：layedit.set 一定要放在 build 前面，否则配置全局接口将无效。
    });

</script>


<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //创建一个编辑器
        var editIndex = layedit.build('demo');

        //自定义验证规则
        form.verify({
            pass: [/(.+){6,12}$/, '密码必须6到12位']
            ,content: function(value){
                layedit.sync(editIndex);
            }
        });

        //监听指定开关
        form.on('switch(switchTest)', function(data){
            layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
                offset: '6px'
            });
            layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
        });



        //监听提交
        form.on('submit(demo1)', function(data){
            $.ajax({
                url: '{:url("User/saveUserInfo")}',
                type: 'post',
                dataType: 'json',
                data: data.field,
                success: function (obj) {
                    if(obj.code==200){
                        parent.layer.msg(obj.msg, {icon: 6,time: 1000});
                        //当你在iframe页面关闭自身时
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layer.close(index,data.field); //再执行关闭
                    }
                    if(obj.code==500){
                        layer.msg(obj.msg, {icon: 5,time: 1000});
                    }
                },
                error:function(data){
                    console.log(data);
                }
            });

        });


    });
</script>

</body>
</html>